﻿@model Century.Framework.Validation.DbProvider.ValidationRule
@{
    Layout = null;
}
@using (Ajax.BeginForm("Save", new AjaxOptions { OnSuccess = "ClosePopUp", HttpMethod = "Post" }))
{
    @Html.HiddenFor(model => model.Domain);
    @Html.HiddenFor(model => model.Id);
    @Html.HiddenFor(model => model.EntityName);
    @Html.HiddenFor(model => model.FieldName);
    @Html.HiddenFor(model => model.PageName);
  
    <div style="background-color:Silver; border-style: solid; border-color:Black; border-width:1px">
        <div>
            @Html.LabelFor(model => model.IsRequired)
        </div>
        <div>
            @Html.CheckBoxFor(model => model.IsRequired)
        </div>
        @if (Model.TagType == "input")
        {
            <div>
                @Html.LabelFor(model => model.IsEmail)
            </div>
            <div>
                @Html.CheckBoxFor(model => model.IsEmail)
            </div>
            <div>
                @Html.LabelFor(model => model.IsNumber)
            </div>
            <div>
                @Html.CheckBoxFor(model => model.IsNumber)
            </div>
           
            <div>
                @Html.LabelFor(model => model.Max)
            </div>
            <div>
                @Html.TextBoxFor(model => model.Max)
            </div>
            <div>
                @Html.LabelFor(model => model.Min)
            </div>
            <div>
                @Html.TextBoxFor(model => model.Min)
            </div>
            <div>
                @Html.LabelFor(model => model.MinLength)
            </div>
            <div>
                @Html.TextBoxFor(model => model.MinLength)
            </div>
            <div>
                @Html.LabelFor(model => model.RegErrorMessage)
            </div>
            <div>
                @Html.TextBoxFor(model => model.RegErrorMessage)
            </div>
            <div>
                @Html.LabelFor(model => model.MaxLength)
            </div>
            <div>
                @Html.TextBoxFor(model => model.MaxLength)
            </div>
            <div>
                @Html.LabelFor(model => model.RegExpression)
            </div>
            <div>
                @Html.TextBoxFor(model => model.RegExpression)
            </div>
        }
        <input type="submit" value="Save" /><input type="button" name="name" value="Cancel"
            onclick="ClosePopUp()" />
    </div>
}
<script type="text/javascript">
    function ClosePopUp(data) {

        $("#ValidationEditorResult").trigger('close');
    }
</script>
